<script setup lang="ts">
import switchTab from "@/common/switchTab";

const handleTo = () => {
  switchTab({
    url: "pages/home/index",
    success: function (res) {
      // 通过eventChannel向被打开页面传送数据
      console.log(res, "--home--");
    },
    fail: (fail) => {
      console.log(fail, "1");
    },
    complete: (complete) => {
      console.log(complete, "3");
    },
  });
};
</script>

<template>
  <view
    class="w-full h-full flex justify-center relative flex-col items-center bg-teal-300"
  >
    <nut-animate type="ripple" :loop="true">
      <nut-button type="primary" @click="handleTo">扫一扫</nut-button>
    </nut-animate>
    <view class="absolute bottom-[150rpx] text-[40rpx] font-bold">
      原子概念
    </view>
  </view>
</template>
